<!DOCTYPE html>
<html lang="en-us">
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    
<meta charset="UTF-8">
<title>Search across clusters | Elasticsearch Guide [7.7] | Elastic</title>
<link rel="home" href="index.html" title="Elasticsearch Guide [7.7]">
<link rel="up" href="search-your-data.html" title="Search your data">
<link rel="prev" href="async-search-intro.html" title="Long-running searches">
<link rel="next" href="query-dsl.html" title="Query DSL">
<meta name="DC.type" content="Learn/Docs/Elasticsearch/Reference/7.7">
<meta name="DC.subject" content="Elasticsearch">
<meta name="DC.identifier" content="7.7">
<meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.optimizely.com/js/18132920325.js"></script>
    <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
    <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="/manifest.json">
    <meta name="apple-mobile-web-app-title" content="Elastic">
    <meta name="application-name" content="Elastic">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/mstile-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <meta name="naver-site-verification" content="936882c1853b701b3cef3721758d80535413dbfd">
    <meta name="yandex-verification" content="d8a47e95d0972434">
    <meta name="localized" content="true">
    <meta name="st:robots" content="follow,index">
    <meta property="og:image" content="https://www.elastic.co/static/images/elastic-logo-200.png">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" sizes="64x64" href="/favicon_64x64_16bit.png">
    <link rel="apple-touch-icon-precomposed" sizes="32x32" href="/favicon_32x32.png">
    <link rel="apple-touch-icon-precomposed" sizes="16x16" href="/favicon_16x16.png">
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/guide/static/styles.css">
  </head>

  <!--© 2015-2021 Elasticsearch B.V. Copying, publishing and/or distributing without written permission is strictly prohibited.-->

  <body>
    <!-- Google Tag Manager -->
    <script>dataLayer = [];</script><noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-58RLH5" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-58RLH5');</script>
    <!-- End Google Tag Manager -->

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-12395217-16"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'UA-12395217-16');
    </script>

    <!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->
    <script type="text/javascript">
      (function(){var g=function(e,h,f,g){
      this.get=function(a){for(var a=a+"=",c=document.cookie.split(";"),b=0,e=c.length;b<e;b++){for(var d=c[b];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null};
      this.set=function(a,c){var b="",b=new Date;b.setTime(b.getTime()+6048E5);b="; expires="+b.toGMTString();document.cookie=a+"="+c+b+"; path=/; "};
      this.check=function(){var a=this.get(f);if(a)a=a.split(":");else if(100!=e)"v"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(":"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case "v":return!1;case "r":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(":")),!c}return!0};
      this.go=function(){if(this.check()){var a=document.createElement("script");a.type="text/javascript";a.src=g;document.body&&document.body.appendChild(a)}};
      this.start=function(){var a=this;window.addEventListener?window.addEventListener("load",function(){a.go()},!1):window.attachEvent&&window.attachEvent("onload",function(){a.go()})}};
      try{(new g(100,"r","QSI_S_ZN_emkP0oSe9Qrn7kF","https://znemkp0ose9qrn7kf-elastic.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_emkP0oSe9Qrn7kF")).start()}catch(i){}})();
    </script><div id="ZN_emkP0oSe9Qrn7kF"><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div>
    <!--END WEBSITE FEEDBACK SNIPPET-->

    <div id="elastic-nav" style="display:none;"></div>
    <script src="https://www.elastic.co/elastic-nav.js"></script>

    <!-- Subnav -->
    <div>
      <div>
        <div class="tertiary-nav d-none d-md-block">
          <div class="container">
            <div class="p-t-b-15 d-flex justify-content-between nav-container">
              <div class="breadcrum-wrapper"><span><a href="/guide/" style="font-size: 14px; font-weight: 600; color: #000;">Docs</a></span></div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="main-container">
      <section id="content">
        <div class="content-wrapper">

          <section id="guide" lang="en">
            <div class="container">
              <div class="row">
                <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                  <!-- start body -->
                  <div class="page_header">
<strong>IMPORTANT</strong>: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
<a href="../current/index.html">current release documentation</a>.
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="search-your-data.html">Search your data</a></span>
»
<span class="breadcrumb-node">Search across clusters</span>
</div>
<div class="navheader">
<span class="prev">
<a href="async-search-intro.html">« Long-running searches</a>
</span>
<span class="next">
<a href="query-dsl.html">Query DSL »</a>
</span>
</div>
<div class="chapter">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="modules-cross-cluster-search"></a>Search across clusters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h2>
</div></div></div>
<p><span class="strong strong"><strong>Cross-cluster search</strong></span> lets you run a single search request against one or more
<a class="xref" href="modules-remote-clusters.html" title="Remote clusters">remote clusters</a>. For example, you can use a cross-cluster search to
filter and analyze log data stored on clusters in different data centers.</p>
<div class="important admon">
<div class="icon"></div>
<div class="admon_content">
<p>Cross-cluster search requires <a class="xref" href="modules-remote-clusters.html" title="Remote clusters">remote clusters</a>.</p>
</div>
</div>
<h3>
<a id="ccs-supported-apis"></a>Supported APIs<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h3>
<p>The following APIs support cross-cluster search:</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<a class="xref" href="search-search.html" title="Search API">Search</a>
</li>
<li class="listitem">
<a class="xref" href="search-multi-search.html" title="Multi Search API">Multi search</a>
</li>
<li class="listitem">
<a class="xref" href="search-template.html" title="Search Template">Search template</a>
</li>
<li class="listitem">
<a class="xref" href="multi-search-template.html" title="Multi Search Template">Multi search template</a>
</li>
</ul>
</div>
<h3>
<a id="ccs-example"></a>Cross-cluster search examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h3>
<h4>
<a id="ccs-remote-cluster-setup"></a>Remote cluster setup<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h4>
<p>To perform a cross-cluster search, you must have at least one remote cluster configured.</p>
<p>The following <a class="xref" href="cluster-update-settings.html" title="Cluster update settings API">cluster update settings</a> API request
adds three remote clusters:<code class="literal">cluster_one</code>, <code class="literal">cluster_two</code>, and <code class="literal">cluster_three</code>.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">PUT _cluster/settings
{
  "persistent": {
    "cluster": {
      "remote": {
        "cluster_one": {
          "seeds": [
            "127.0.0.1:9300"
          ]
        },
        "cluster_two": {
          "seeds": [
            "127.0.0.1:9301"
          ]
        },
        "cluster_three": {
          "seeds": [
            "127.0.0.1:9302"
          ]
        }
      }
    }
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/88.console"></div>
<h4>
<a id="ccs-search-remote-cluster"></a>Search a single remote cluster<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h4>
<p>The following <a class="xref" href="search-search.html" title="Search API">search</a> API request searches the
<code class="literal">twitter</code> index on a single remote cluster, <code class="literal">cluster_one</code>.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /cluster_one:twitter/_search
{
  "query": {
    "match": {
      "user": "kimchy"
    }
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/89.console"></div>
<p>The API returns the following response:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "took": 150,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "failed": 0,
    "skipped": 0
  },
  "_clusters": {
    "total": 1,
    "successful": 1,
    "skipped": 0
  },
  "hits": {
    "total" : {
        "value": 1,
        "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "cluster_one:twitter", <a id="CO33-1"></a><i class="conum" data-value="1"></i>
        "_type": "_doc",
        "_id": "0",
        "_score": 1,
        "_source": {
          "user": "kimchy",
          "date": "2009-11-15T14:12:12",
          "message": "trying out Elasticsearch",
          "likes": 0
        }
      }
    ]
  }
}</pre>
</div>
<div class="calloutlist">
<table border="0" summary="Callout list">
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO33-1"><i class="conum" data-value="1"></i></a></p>
</td>
<td align="left" valign="top">
<p>The search response body includes the name of the remote cluster in the
<code class="literal">_index</code> parameter.</p>
</td>
</tr>
</table>
</div>
<h4>
<a id="ccs-search-multi-remote-cluster"></a>Search multiple remote clusters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h4>
<p>The following <a class="xref" href="search.html" title="Search APIs">search</a> API request searches the <code class="literal">twitter</code> index on
three clusters:</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
Your local cluster
</li>
<li class="listitem">
Two remote clusters, <code class="literal">cluster_one</code> and <code class="literal">cluster_two</code>
</li>
</ul>
</div>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /twitter,cluster_one:twitter,cluster_two:twitter/_search
{
  "query": {
    "match": {
      "user": "kimchy"
    }
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/90.console"></div>
<p>The API returns the following response:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "took": 150,
  "timed_out": false,
  "num_reduce_phases": 4,
  "_shards": {
    "total": 3,
    "successful": 3,
    "failed": 0,
    "skipped": 0
  },
  "_clusters": {
    "total": 3,
    "successful": 3,
    "skipped": 0
  },
  "hits": {
    "total" : {
        "value": 3,
        "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "twitter", <a id="CO34-1"></a><i class="conum" data-value="1"></i>
        "_type": "_doc",
        "_id": "0",
        "_score": 2,
        "_source": {
          "user": "kimchy",
          "date": "2009-11-15T14:12:12",
          "message": "trying out Elasticsearch",
          "likes": 0
        }
      },
      {
        "_index": "cluster_one:twitter", <a id="CO34-2"></a><i class="conum" data-value="2"></i>
        "_type": "_doc",
        "_id": "0",
        "_score": 1,
        "_source": {
          "user": "kimchy",
          "date": "2009-11-15T14:12:12",
          "message": "trying out Elasticsearch",
          "likes": 0
        }
      },
      {
        "_index": "cluster_two:twitter", <a id="CO34-3"></a><i class="conum" data-value="3"></i>
        "_type": "_doc",
        "_id": "0",
        "_score": 1,
        "_source": {
          "user": "kimchy",
          "date": "2009-11-15T14:12:12",
          "message": "trying out Elasticsearch",
          "likes": 0
        }
      }
    ]
  }
}</pre>
</div>
<div class="calloutlist">
<table border="0" summary="Callout list">
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO34-1"><i class="conum" data-value="1"></i></a></p>
</td>
<td align="left" valign="top">
<p>This document’s <code class="literal">_index</code> parameter doesn’t include a cluster name. This
means the document came from the local cluster.</p>
</td>
</tr>
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO34-2"><i class="conum" data-value="2"></i></a></p>
</td>
<td align="left" valign="top">
<p>This document came from <code class="literal">cluster_one</code>.</p>
</td>
</tr>
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO34-3"><i class="conum" data-value="3"></i></a></p>
</td>
<td align="left" valign="top">
<p>This document came from <code class="literal">cluster_two</code>.</p>
</td>
</tr>
</table>
</div>
<h3>
<a id="skip-unavailable-clusters"></a>Skip unavailable clusters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h3>
<p>By default, a cross-cluster search returns an error if <span class="strong strong"><strong>any</strong></span> cluster in the request is
unavailable.</p>
<p>To skip an unavailable cluster during a cross-cluster search, set the
<a class="xref" href="cluster-remote-info.html#skip-unavailable"><code class="literal">skip_unavailable</code></a> cluster setting to <code class="literal">true</code>.</p>
<p>The following <a class="xref" href="cluster-update-settings.html" title="Cluster update settings API">cluster update settings</a> API request
changes <code class="literal">cluster_two</code>'s <code class="literal">skip_unavailable</code> setting to <code class="literal">true</code>.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">PUT _cluster/settings
{
  "persistent": {
    "cluster.remote.cluster_two.skip_unavailable": true
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/91.console"></div>
<p>If <code class="literal">cluster_two</code> is disconnected or unavailable during a cross-cluster search, Elasticsearch won’t
include matching documents from that cluster in the final results.</p>
<h3>
<a id="ccs-gateway-seed-nodes"></a>Selecting gateway and seed nodes in sniff mode<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h3>
<p>For remote clusters using the <a class="xref" href="modules-remote-clusters.html#sniff-mode" title="Sniff mode">sniff connection</a> mode, gateway and
seed nodes need to be accessible from the local cluster via your network.</p>
<p>By default, any non-<a class="xref" href="modules-node.html#master-node" title="Master-eligible node">master-eligible</a> node can act as a
gateway node. If wanted, you can define the gateway nodes for a cluster by
setting <code class="literal">cluster.remote.node.attr.gateway</code> to <code class="literal">true</code>.</p>
<p>For cross-cluster search, we recommend you use gateway nodes that are capable of serving as
<a class="xref" href="modules-node.html#coordinating-node" title="Coordinating node">coordinating nodes</a> for search requests. If
wanted, the seed nodes for a cluster can be a subset of these gateway nodes.</p>
<h3>
<a id="ccs-proxy-mode"></a>Cross-cluster search in proxy mode<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h3>
<p><a class="xref" href="modules-remote-clusters.html#proxy-mode" title="Proxy mode">Proxy mode</a> remote cluster connections support cross-cluster search. All remote
connections connect to the configured <code class="literal">proxy_address</code>. Any desired connection
routing to gateway or <a class="xref" href="modules-node.html#coordinating-node" title="Coordinating node">coordinating nodes</a> must
be implemented by the intermediate proxy at this configured address.</p>
<h3>
<a id="ccs-network-delays"></a>How cross-cluster search handles network delays<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h3>
<p>Because cross-cluster search involves sending requests to remote clusters, any network delays
can impact search speed. To avoid slow searches, cross-cluster search offers two options for
handling network delays:</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<a class="xref" href="modules-cross-cluster-search.html#ccs-min-roundtrips" title="Minimize network roundtrips">Minimize network roundtrips</a>
</span>
</dt>
<dd>
<p>
By default, Elasticsearch reduces the number of network roundtrips between remote
clusters. This reduces the impact of network delays on search speed. However,
Elasticsearch can’t reduce network roundtrips for large search requests, such as those
including a <a class="xref" href="search-request-body.html#request-body-search-scroll" title="Scroll">scroll</a> or
<a class="xref" href="search-request-body.html#request-body-search-inner-hits" title="Inner hits">inner hits</a>.
</p>
<p>See <a class="xref" href="modules-cross-cluster-search.html#ccs-min-roundtrips" title="Minimize network roundtrips">Minimize network roundtrips</a> to learn how this option works.</p>
</dd>
<dt>
<span class="term">
<a class="xref" href="modules-cross-cluster-search.html#ccs-unmin-roundtrips" title="Don’t minimize network roundtrips">Don’t minimize network roundtrips</a>
</span>
</dt>
<dd>
<p>
For search
requests that include a scroll or inner hits, Elasticsearch sends multiple outgoing and
ingoing requests to each remote cluster. You can also choose this option by
setting the <a class="xref" href="search-search.html#ccs-minimize-roundtrips"><code class="literal">ccs_minimize_roundtrips</code></a> parameter to
<code class="literal">false</code>. While typically slower, this approach may work well for networks with
low latency.
</p>
<p>See <a class="xref" href="modules-cross-cluster-search.html#ccs-unmin-roundtrips" title="Don’t minimize network roundtrips">Don’t minimize network roundtrips</a> to learn how this option works.</p>
</dd>
</dl>
</div>
<h4>
<a id="ccs-min-roundtrips"></a>Minimize network roundtrips<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h4>
<p>Here’s how cross-cluster search works when you minimize network roundtrips.</p>
<div class="olist orderedlist">
<ol class="orderedlist">
<li class="listitem">
<p>You send a cross-cluster search request to your local cluster. A coordinating node in that
cluster receives and parses the request.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-client-request.svg" alt="ccs min roundtrip client request"></span></p>
</li>
<li class="listitem">
<p>The coordinating node sends a single search request to each cluster, including
the local cluster. Each cluster performs the search request independently,
applying its own cluster-level settings to the request.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-cluster-search.svg" alt="ccs min roundtrip cluster search"></span></p>
</li>
<li class="listitem">
<p>Each remote cluster sends its search results back to the coordinating node.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-cluster-results.svg" alt="ccs min roundtrip cluster results"></span></p>
</li>
<li class="listitem">
<p>After collecting results from each cluster, the coordinating node returns the
final results in the cross-cluster search response.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-client-response.svg" alt="ccs min roundtrip client response"></span></p>
</li>
</ol>
</div>
<h4>
<a id="ccs-unmin-roundtrips"></a>Don’t minimize network roundtrips<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/modules/cross-cluster-search.asciidoc">edit</a>
</h4>
<p>Here’s how cross-cluster search works when you don’t minimize network roundtrips.</p>
<div class="olist orderedlist">
<ol class="orderedlist">
<li class="listitem">
<p>You send a cross-cluster search request to your local cluster. A coordinating node in that
cluster receives and parses the request.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-client-request.svg" alt="ccs min roundtrip client request"></span></p>
</li>
<li class="listitem">
<p>The coordinating node sends a <a class="xref" href="search-shards.html" title="Search Shards API">search shards</a> API request to
each remote cluster.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-cluster-search.svg" alt="ccs min roundtrip cluster search"></span></p>
</li>
<li class="listitem">
<p>Each remote cluster sends its response back to the coordinating node.
This response contains information about the indices and shards the cross-cluster search
request will be executed on.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-cluster-results.svg" alt="ccs min roundtrip cluster results"></span></p>
</li>
<li class="listitem">
<p>The coordinating node sends a search request to each shard, including those in
its own cluster. Each shard performs the search request independently.</p>
<div class="warning admon">
<div class="icon"></div>
<div class="admon_content">
<p>When network roundtrips aren’t minimized, the search is executed as if all data
were in the coordinating node’s cluster. We recommend updating cluster-level
settings that limit searches, such as <code class="literal">action.search.shard_count.limit</code>,
<code class="literal">pre_filter_shard_size</code>, and <code class="literal">max_concurrent_shard_requests</code>, to account for
this. If these limits are too low, the search may be rejected.</p>
</div>
</div>
<p><span class="image"><img src="images/ccs/ccs-dont-min-roundtrip-shard-search.svg" alt="ccs dont min roundtrip shard search"></span></p>
</li>
<li class="listitem">
<p>Each shard sends its search results back to the coordinating node.</p>
<p><span class="image"><img src="images/ccs/ccs-dont-min-roundtrip-shard-results.svg" alt="ccs dont min roundtrip shard results"></span></p>
</li>
<li class="listitem">
<p>After collecting results from each cluster, the coordinating node returns the
final results in the cross-cluster search response.</p>
<p><span class="image"><img src="images/ccs/ccs-min-roundtrip-client-response.svg" alt="ccs min roundtrip client response"></span></p>
</li>
</ol>
</div>
</div>
<div class="navfooter">
<span class="prev">
<a href="async-search-intro.html">« Long-running searches</a>
</span>
<span class="next">
<a href="query-dsl.html">Query DSL »</a>
</span>
</div>
</div>

                  <!-- end body -->
                </div>
                <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                  <div id="rtpcontainer" style="display: block;">
                    <div class="mktg-promo">
                      <h3>Most Popular</h3>
                      <ul class="icons">
                        <li class="icon-elasticsearch-white"><a href="https://www.elastic.co/webinars/getting-started-elasticsearch?baymax=default&amp;elektra=docs&amp;storm=top-video">Get Started with Elasticsearch: Video</a></li>
                        <li class="icon-kibana-white"><a href="https://www.elastic.co/webinars/getting-started-kibana?baymax=default&amp;elektra=docs&amp;storm=top-video">Intro to Kibana: Video</a></li>
                        <li class="icon-logstash-white"><a href="https://www.elastic.co/webinars/introduction-elk-stack?baymax=default&amp;elektra=docs&amp;storm=top-video">ELK for Logs &amp; Metrics: Video</a></li>
                      </ul>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </section>

        </div>


<div id="elastic-footer"></div>
<script src="https://www.elastic.co/elastic-footer.js"></script>
<!-- Footer Section end-->

      </section>
    </div>

<script src="/guide/static/jquery.js"></script>
<script type="text/javascript" src="/guide/static/docs.js"></script>
<script type="text/javascript">
  window.initial_state = {}</script>
  </body>
</html>
